package main

import (
	"cp2"
	"fmt"
)

func main() {
	fmt.Println(cp2.BoilingC - cp2.FreezingC)
	boilingF := cp2.CToF(cp2.BoilingC)
	fmt.Println(boilingF - cp2.CToF(cp2.FreezingC))
	//即使底层类型一样，但type不行就不能进行运算、比较等
	//fmt.Println(boilingF - cp2.FreezingC)
	fmt.Println("-----声明type类型的方法--------")
	c := cp2.FToC(boilingF)
	fmt.Println(c.String()) // "100°C"
	fmt.Printf("%v\n", c)   // "100°C"; no need to call String explicitly
	fmt.Printf("%s\n", c)   // "100°C"
	fmt.Println(c)          // "100°C"
	fmt.Printf("%g\n", c)   // "100"; does not call String
	fmt.Println(float64(c)) // "100"; does not call String

}
